<%-- 
    Document   : home
    Created on : Mar 20, 2012, 1:58:42 PM
    Author     : berto
--%>
<%@page import="it.unitn.science.matr155863_148346_145963.bccastestore.items.Product"%>
<%@page import="java.util.ArrayList"%>
<%@page import="it.unitn.science.matr155863_148346_145963.bccastestore.items.Category"%>
<%@page import ="it.unitn.science.matr155863_148346_145963.bccastestore.DBManager"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%!

   private ArrayList<Category> listCat;
   public void jspInit(){
    DBManager db=(DBManager)super.getServletContext().getAttribute("db_manager");
     listCat=db.getCategories();   
  }
%>
      

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Public menu</title>
    </head>
    <body>
        <h2>Public area:</h2>
	  <ul>
            <%
            for(Category c:listCat){
                %>
                <li><a href="<%=response.encodeURL(request.getContextPath()+"/contents/user/searchProduct?category="+c.getId())%>" title="Search <%=c.getName()%>"><h3><%=c.getName()%></h3></a></li>
                <%
            }
            %>
            </ul>
    </body>
</html>